<template>
    <div class="contain-box">
        <div class="col_left">
            <list class="list" :questionList="questionList" :locationObj="locationObj"></list>
        </div>
        <div class="col_right">
            <dtl :questionList="questionList" :locationObj="locationObj"></dtl>
        </div>

    </div>
</template>

<script>
import list from './questionList'
import dtl from './questionDtl'
import utils from '@/plugins/common/utils';

export default {
    name: 'index',
    components: {
        list,
        dtl
    },
    data() {
        return {
            locationObj: {},
            questionList: [{
                type: '单选题',
                quest: []
            }, {
                type: '多选题',
                quest: []
            }]
        }
    },
    mounted() {
        this.locationObj = utils.getQueryObject(location.href);

        this.$api.ajaxData({
            authorization: true,
            pathName: 'doQueryTestReport',
            data: {
                test_id: this.locationObj.test_id,
                batch_id: this.locationObj.batch_id,
                test_name: this.locationObj.test_name,
            },
            method: 'post'
        }).then(res => {
            console.log(res);
            if (res.obj.length > 0) {
                res.obj.forEach((item, index) => {
                    console.log(item.user_anser, index);
                    if (item.ques_type == 1) {
                        this.questionList[0].quest.push(item)
                    } else {
                        this.questionList[1].quest.push(item)

                    }
                })
            }
        })
    },
    methods: {}
}
</script>

<style scoped lang="scss">
.list {
    box-shadow: rgba(204, 204, 204, 0.498) 0px 0px 10px
}

.contain-box {
    display: flex;
    //min-height: 100vh;
    .col_left {
        //flex: 1;
        width: 250px;
    }

    .col_right {
        width: calc(100% - 255px);
        //flex:1;
        //min-width: 600px;
        height: calc(100vh - 60px);
        overflow-y: auto;
    }
}
</style>
